﻿<div class="top-row ps-3 navbar navbar-dark">
	<div class="container-fluid">
		<a class="navbar-brand" href="">Blazor wasm sample</a>
		<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
			<span class="navbar-toggler-icon"></span>
		</button>
	</div>
</div>

<div class="@NavMenuCssClass scroll-y" @onclick="ToggleNavMenu">
	<nav class="flex-column">
		@foreach (var item in Index)
		{
			<div class="nav-item px-3">
				<NavLink class="nav-link" href="@item">@item</NavLink>
			</div>
		}
	</nav>
</div>

@code {
	private bool collapseNavMenu = true;

	private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

	public string[] Index { get; set; } = ViewModelsSamples.Index.Samples;

	private void ToggleNavMenu()
	{
		collapseNavMenu = !collapseNavMenu;
	}
}
